Sync the display when creating a native window.
authorAlexander Larsson <alexl@redhat.com>
Thu, 29 Jan 2009 16:36:17 +0000 (17:36 +0100)
committerAlexander Larsson <alex@localhost.localdomain>
Thu, 2 Apr 2009 08:15:29 +0000 (10:15 +0200)
This is needed because we want to be able to use the xid immediately
even from another process or another connection to the display.

gdk/gdkwindow.c

index 102fc903e76e119e8a5301c2b40bdbf46fba289e..b4428651efa7e39ae662d449e0371df01912a9fe 100644 (file)
@@ -1305,6 +1305,12 @@ gdk_window_set_has_native (GdkWindow *window, gboolean has_native)
 
       if (gdk_window_is_viewable (window))
        GDK_WINDOW_IMPL_GET_IFACE (private->impl)->show (window);
+
+      /* We sync here to ensure the window is created in the Xserver when
+       * this function returns. This is required because the returned XID
+       * for this window must be valid immediately, even with another
+       * connection to the Xserver */
+      gdk_display_sync (gdk_drawable_get_display (window));
     }
   else
     {